"""评估诊断数据模型"""
from pydantic import BaseModel
from typing import Optional, List, Dict, Any
from datetime import datetime


class AssessmentResultBase(BaseModel):
    """评估结果基础模型"""
    user_id: str
    assessment_type: str  # initial, learning_style, weakness


class InitialAssessmentResult(AssessmentResultBase):
    """初始能力评估结果"""
    assessment_id: str
    legal_basics_score: float
    thinking_rigor_score: float
    answer_speed_score: float
    knowledge_breadth_score: float
    overall_score: float
    assessed_at: datetime
    recommendations: List[str] = []


class LearningStyleResult(AssessmentResultBase):
    """学习风格诊断结果"""
    learning_style: str
    preferences: Dict[str, Any]
    assessed_at: datetime


class WeaknessAnalysis(AssessmentResultBase):
    """薄弱环节分析结果"""
    weak_areas: List[Dict[str, Any]]
    strong_areas: List[Dict[str, Any]]
    recommendations: List[str]
    analyzed_at: datetime


class ErrorAttribution(BaseModel):
    """错误归因分析"""
    user_id: str
    question_id: str
    error_type: str  # knowledge, thinking, technique, attention
    error_category: str
    error_details: Dict[str, Any]
    recommendations: List[str]
    analyzed_at: datetime


class AccuracyPrediction(BaseModel):
    """正确率预测"""
    user_id: str
    current_accuracy: float
    predicted_accuracy: float
    prediction_days: int
    confidence_interval: Dict[str, float]
    learning_curve: List[Dict[str, Any]]
    predicted_at: datetime

